ajax请求asp.net webservice格式

1
2
3
4
5
6
7
8
9
10
11
12
13
$.ajax({
  type: "post",
  url: "your_webservice.asmx/you_method",
  contentType: "application/json; charset=utf-8",
  dataType: "json",
  data: '{parameter_key:"parameter_value"}',
  success: function (data) {
  alert(data.d);
  },
  error: function () {
  alert("fail");
  }
});

注:数据格式均采用json